#include "stdafx.h"
#include <locale>
#include <codecvt>
#include <boost/uuid/nil_generator.hpp>
#include <boost/uuid/string_generator.hpp>
#include <boost/uuid/name_generator.hpp>
#include <boost/uuid/random_generator.hpp>
#include <boost/uuid/uuid_io.hpp>

wstring ToWString(const string& str)
{
	std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
	return converter.from_bytes(str);
}


string ToString(const wstring& str)
{
	std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
	return converter.to_bytes(str);
}
class GenUUID :public InstanceObj<GenUUID>
{
public:
	GenUUID()
	{

	}
	string Gen()
	{
		boost::uuids::uuid u = gen();
		std::string s1 = to_string(u);
		return s1;
	}
protected:
private:
	boost::uuids::random_generator gen;
};
string CreateUUid()
{
	return GenUUID::GetInstance()->Gen();
}
